// 导入koa
const Koa = require('koa')
const bodyParser = require('koa-bodyparser');
const router = require('./router/index')
// 创建一个koa对象
const app = new Koa()

app.use(bodyParser());//中间件
app.use(router.routes()); //路由
//监听端口
const port = 3000
app.listen(port);
console.log(`启动成功,服务端口为:${port}`)
